package org.bpm.models
{
	import flash.geom.Rectangle;
	
	import org.bpm.view.MapNode;

	/**
	 * Map model contains all nodes information.
	 * */
	public class MapModel
	{
		/**
		 * Display area of the map.
		 * */
		public var rect:Rectangle;
		public var label:String;
		public var id:String;
		public var nodes:Array;
		
		public function MapModel(pGPDXML:XMLList, pPDXML:XMLList)
		{
			id = pGPDXML.@name;
			label = pGPDXML.@name;
			rect = new Rectangle(0,0,Number(pGPDXML.@width),Number(pGPDXML.@height));
			
			
			nodes = new Array();
			
			for(var i:int=0;i<pPDXML.children().length();i++){
				nodes.push(new MapNodeModel(pGPDXML.child(i), pPDXML.child(i)));
			}
			
		}
	}
}